<?php
require_once('../model/changeArt.php');
if ($_SERVER['REQUEST_METHOD'] == "POST") {
  $aid = $_POST['aid'] ;
  $title = trim($_POST['title']);
  $bid = $_POST['board'];
  $text = $_POST['text'];
  // echo $aid;
  // echo "<br>";
  // echo $title;
  // echo "<br>";
  // echo $bid;
  // echo "<br>";
  // echo $text;

  $successMsg = changeArt($aid, $title, $bid, $text);
  if ($successMsg) {
    header("Location: ../view/changeArt.php?aid={$aid}&success=1");
    exit();
  } else {
    header("Location: ../view/changeArt.php?aid={$aid}&success=0");
    exit();
  }
}
?>